<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form id="form">

<input type="text" name="userName" >用户名<br>
<input type="text" name="password" >密码<br>
<input type="button" id="btnLogin" name="submit" value="登录">
<input type="reset" name="reset" value="重置">
</form>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
$("#btnLogin").click(function () {
    var userinfo = $("#form").serialize();
    $.ajax({
        url:'/login/login',
        type: 'get',
        data: userinfo,
        dataType:'json',
        success:function (res) {
            if(res.success){
                window.location.href="list.html"
            }else{
                alert(res.msg)
            }
        }
    })
})
</script>
</body>
</html>